﻿Public Class TraCuuHK
    Inherits DataProvider

    Public Function dtload() As DataSet
        Dim sqlstr As String = "SELECT * FROM HanhKhach"
        Return GetDT(sqlstr)
    End Function

    Public Function delhk(ByVal mahk As Integer) As Integer
        Dim sqlstr As String = "DELETE FROM HanhKhach WHERE ID=" + mahk.ToString
        Return Me.SaveData(sqlstr)
    End Function
    Public Function Findhk(ByVal dtohk As DTO.TraCuuHK) As DataSet
        Dim sqlstr As String = "SELECT * FROM HanhKhach WHERE HoTen Like '%" + dtohk.hotenhk + "%' AND DienThoai LIKE '%" + dtohk.dthk + "%' AND CMND LIKE '%" + dtohk.cmndhk + "%'"
        Return Me.GetDT(sqlstr)
    End Function

    Public Function laydthanhkhach() As DataSet
        Dim sql As String = "SELECT * FROM HanhKhach"
        Return GetDT(sql)
    End Function
End Class
